package org.emaait.app.service.impl;

import java.sql.SQLException;

import org.emaait.app.dao.BaseDao;
import org.emaait.app.model.User;
import org.emaait.app.service.IUserService;

public class UserServiceImpl implements IUserService {
	private static final String INSERT="user.insert";
	public User create(User user) {
		try {
			Object id=baseDao.save(INSERT, user);
			System.out.println(id+"\t"+id.getClass());
		} catch (SQLException e) {
			e.printStackTrace();
		}
		//if(true)
		//	throw new RuntimeException("事务测试！");
		log.info("In "+this.getClass().getName()+" class create method!!!"+user);
		return user;
	}
	
	private BaseDao baseDao;
	
	public BaseDao getBaseDao() {
		return baseDao;
	}
	public void setBaseDao(BaseDao baseDao) {
		this.baseDao = baseDao;
	}
}
